package com.atrix.CinemaView.pojo.dto.info;

import com.atrix.CinemaView.pojo.Container;
import com.atrix.CinemaView.pojo.FileObj;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.stream.Collectors;

@Data
@ApiModel("文档信息")
public class MdInfo {
    @ApiModelProperty("文档容器名称")
    private String containerName;
    @ApiModelProperty("文档名称列表")
    private List<String> mdNameList;
    
    public MdInfo(Container<FileObj> container) {
        this.containerName = container.getName();
        this.mdNameList = container.getData()
                .stream().map(FileObj::getName).collect(Collectors.toList());
    }
}
